import { stringify } from 'qs';
import request from '@/utils/request';
import {formDataCode} from '@/utils/utils';

// 获取自提订单列表
export async function GetOrderList(params) {
    return request(`/${window.storeId}/PickUpOrder/GetOrderList?${stringify(params)}`);
}

// 订单批量备货
export async function StockUpBatch(params) {       
    return request(`/${window.storeId}/PickUpOrder/StockUpBatch`, {
      method: 'POST',
      body: {
        ...params
      }
    });
}

//根据提货码获取核销信息
export async function GetSelfFetchOrder(params) {
    return request(`/${window.storeId}/PickUpOrder/GetSelfFetchOrder?${stringify(params)}`);
}

//核销
export async function SetFinishOrder(params) {       
    return request(`/${window.storeId}/PickUpOrder/SetFinishOrder`, {
      method: 'POST',
      headers:{
        'Content-Type':"application/x-www-form-urlencoded",        
    },
    body: formDataCode(params)
    });
}

//获取小程序码
export async function GetWxCode(params) {
    return request(`/${window.storeId}/PickUpOrder/GetWxCode?${stringify(params)}`);
}

